﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharpWeb
{
    /// <summary>
    /// select标签
    /// </summary>
    public class SelectTag : TagComponent
    {
        public SelectTag()
        {
            _Options = new OptionTagCollection();
        }
        protected override string TagName
        {
            get { return "select"; }
        }

        protected override bool CloseItSelf
        {
            get { return false; }
        }

        private readonly OptionTagCollection _Options;

        public OptionTagCollection Options
        {
            get { return _Options; }
        }

        protected override void OnRenderContent(StringBuilder sb, ComponentContext context)
        {
            base.OnRenderContent(sb, context);
            foreach (var item in this.Options)
            {
                item.RenderComponent(sb, context);
            }
        }
    }
}
